package site.eblog.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import site.eblog.dao.TagMapper;

@Transactional
@Service
public class TagServiceImpl implements TagService {

	@Autowired TagMapper tagMapper;
	
	@Override
	public List<String> getTags() {
		List<String> tags = new ArrayList<>();
		tags = tagMapper.getTags();
		return tags;
	}

	@Override
	public int addTag(String name) {
		int res = tagMapper.addTag(name);
		return res;
	}

	@Override
	public int updateTag(Map<String, String> map) {
		int res = tagMapper.updateTag(map);
		return res;
	}

	@Override
	public int delTag(String tagName) {
		int res = tagMapper.delTag(tagName);
		return res;
	}

}
